package cn.liumouren.tool.pad.config;

import cn.liumouren.tool.security.core.DefaultPermission;
import cn.liumouren.tool.security.core.TokenProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Daniel Liu
 * @date 2021/3/8 18:42
 */
@Configuration
public class SecurityConfig {

    @Bean
    public TokenProcessor tokenProcessor() {
        return s -> {
            String[] split = s.split(",");
            DefaultPermission defaultPermission = new DefaultPermission();
            defaultPermission.add(split);
            return defaultPermission;
        };
    }
}
